﻿namespace Vibstudio.NetConfigurator.IoC.Configuration
{
    using System;
    using System.Configuration;

    public class NcConfiguration : ConfigurationSection
    {
        public static NcConfiguration GetConfig(string sectionName)
        {
            if (String.IsNullOrEmpty(sectionName)) throw new ArgumentNullException("sectionName");

            try
            {
                return (NcConfiguration) ConfigurationManager.GetSection(sectionName);
            }
            catch (Exception exception)
            {
                string s = exception.Message;
                throw;
            }
        }

        [ConfigurationProperty("NcSettings")]
        public NcSettingCollection NcSettings
        {
            get { return (NcSettingCollection)this["NcSettings"] ?? new NcSettingCollection(); }
        }
    }
}
